home *** CD-ROM | disk | FTP | other *** search
File List | 1994-09-22 | 952 b | 33 lines |
- '
- ' Written in GFA Basic (3.5) code
- '
- ' Converted from STOS code to read the parallel port (with joystick adapter) by
- ' Richard Morris 23/sept/1994 9:10pm (Don't know who the original author was)
- ' e-mail: r.m.morris@massey.ac.nz (probably only until around November 1994)
- '
- a%=XBIOS(28,0,7) !Was 192 on my computer (1040STfm)
- b%=XBIOS(28,0,14) !35
- c%=XBIOS(28,0,15) !0
- CLS
- PRINT AT(1,1);"Press any key to exit"
- PRINT
- PRINT "Joystick 0","Joystick 1","Button 0","Button 1"
- REPEAT
- read_stick
- PRINT AT(1,4);j0%,j1%,btn0%,btn1%,
- UNTIL INKEY$<>""
- ' must do this else can't read floppy drive
- ' not sure if values ever differ - so just return to the original values
- ~XBIOS(28,a%,128+7)
- ~XBIOS(28,b%,128+14)
- ~XBIOS(28,c%,128+15)
- > PROCEDURE read_stick
- ~XBIOS(28,0,128+7)
- j0%=XBIOS(28,0,128+15)
- j1%=AND(j0%,&HF0)
- j1%=ROR(j1%,4)
- j0%=AND(&HF,j0%)
- btn0%=NOT BTST(XBIOS(28,0,128+14),5)
- btn1%=NOT BTST(PEEK(&HFFFA01),0)
- RETURN
-